/* This file contains replication code for Sudbury and Vossler, "Checking Out Checkout Charity: A Study of Point-of-Sale Donation Campaigns." */
/* The associated data file is "SV replication data.dta" */
/* If you have comments or questions, contact Chrisitan Vossler (cvossler@utk.edu) */
/* Last revised August 20, 2022 */

/* load data */
clear all
cd "D:\Research\Checkout charity\Analysis\"
use "SV replication data.dta"


/* Data analysis */


/* Table 2. Experimental design summary, donation rates, and revenue */
// Rounding
tabulate Donated Information if Rounding==1 & cent25==1
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent25==1 & Information==0
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent25==1 & Information==1
tabulate Donated Information if Rounding==1 & cent50==1
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent50==1 & Information==0
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent50==1 & Information==1
tabulate Donated Information if Rounding==1 & cent75==1
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent75==1 & Information==0
sum Donated DonationAmtGave AmountDonated if Rounding==1 & cent75==1 & Information==1
// Fixed request
tabulate Donated Information if FixedRequest==1 & cent25==1
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent25==1 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent25==1 & Information==1
tabulate Donated Information if FixedRequest==1 & cent50==1
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent50==1 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent50==1 & Information==1
tabulate Donated Information if FixedRequest==1 & cent75==1
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent75==1 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & cent75==1 & Information==1
tabulate Donated Information if FixedRequest==1 & Ask==1
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==1 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==1 & Information==1
tabulate Donated Information if FixedRequest==1 & Ask==1.5
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==1.5 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==1.5 & Information==1
tabulate Donated Information if FixedRequest==1 & Ask==2
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==2 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==2 & Information==1
tabulate Donated Information if FixedRequest==1 & Ask==3
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==3 & Information==0
sum Donated DonationAmtGave AmountDonated if FixedRequest==1 & Ask==3 & Information==1
// Open-ended
tabulate Donated Information if OpenEnded==1
sum Donated DonationAmtGave AmountDonated if OpenEnded==1 & Information==0
sum Donated DonationAmtGave AmountDonated if OpenEnded==1 & Information==1


/* Table 3. Data description */
sum Donated AmountDonated FixedRequest Rounding OpenEnded cent50 cent75 LessChange MoreChange Information Male Age Earnings


** Analysis of donation rates (Section 4.2)
*tests that pool across information treatments
tabulate Donated Rounding if OpenEnded!=1, exact  // Rounding versus Fixed Request
tabulate Donated Rounding if FixedRequest!=1, exact // Rounding versus Open-ended
tabulate Donated FixedRequest if Rounding!=1, exact // FixedRequest versus Open-ended
*tests that pool across information treatments, conditional on the amount of the ask
tabulate Donated FixedRequest if Rounding==1 | (FixedRequest==1 & Ask<1), exact // FR v. Rounding for asks < $1
tabulate Donated OpenEnded if (FixedRequest==1 & Ask<1) | OpenEnded==1, exact // FR v. Open-ended for asks < $1
gen temp=0
replace temp=1 if Donated & AmountDonated>=1
tabulate temp OpenEnded if (FixedRequest==1 & Ask>=1) | OpenEnded==1, exact // FR v. Open-ended for asks >= $1
drop temp
*tests of equal donation rates across asks
tabulate Donated Ask if FixedRequest==1 & Information==1, exact(7)
tabulate Donated Ask if FixedRequest==1 & Information==0, exact(7)
tabulate Donated Ask if Rounding==1 & Information==1, exact
tabulate Donated Ask if Rounding==1 & Information==0, exact


/* Table 4. Analysis of donation rates */
// Model (1)
regress Donated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (2)
reg Donated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information Earnings Age Male, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information


/* Table 5. Analysis of donation rates, conditional on asks of under $1 */
// Model (1)
regress Gave2 FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information if retain==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (2)
regress Gave2 FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information cent50 cent75 if retain==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (3)
reg Gave2 FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information cent50 cent75 Earnings Age Male if retain==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information


/* Table 6. Analysis of loose change effects for closed-ended mechanisms */
// Calculate donation rates by subgroup and ask
sum Donated if MoreChange==1 & FixedRequest==1 & retain==1 & cent25==1
sum Donated if MoreChange==1 & FixedRequest==1 & retain==1 & cent50==1
sum Donated if MoreChange==1 & FixedRequest==1 & retain==1 & cent75==1
sum Donated if LessChange==1 & FixedRequest==1 & retain==1 & cent25==1
sum Donated if LessChange==1 & FixedRequest==1 & retain==1 & cent50==1
sum Donated if LessChange==1 & FixedRequest==1 & retain==1 & cent75==1
sum Donated if LessChange==1 & Rounding==1 & cent25==1
sum Donated if LessChange==1 & Rounding==1 & cent50==1
sum Donated if LessChange==1 & Rounding==1 & cent75==1
// test less change = more change (fixed request), by ask
tabulate Donated loosechangeeffect if FixedRequest==1 & loosechangeeffect!=1 & retain==1 & cent25==1, exact  // test at $0.25
tabulate Donated loosechangeeffect if FixedRequest==1 & loosechangeeffect!=1 & retain==1 & cent50==1, exact // test at $0.50
tabulate Donated loosechangeeffect if FixedRequest==1 & loosechangeeffect!=1 & retain==1 & cent75==1, exact // test at $0.75
// test less change (fixed) = Rounding, by ask
tabulate Donated Rounding if LessChange==1 & retain==1 & cent25==1, exact // test at $0.25
tabulate Donated Rounding if LessChange==1 & retain==1 & cent50==1, exact // test at $0.50
tabulate Donated Rounding if LessChange==1 & retain==1 & cent75==1, exact // test at $0.75


** Providing information on the charity (Section 4.2.2)
// test information effect by mechanism
tabulate Donated Information if FixedRequest==1, exact
tabulate Donated Information if Rounding==1, exact
tabulate Donated Information if OpenEnded==1, exact
// test Information effect among less change participants in fixed request treatment
sum Donated if LessChange==1 & FixedRequest==1 & Information==0 
sum Donated if LessChange==1 & FixedRequest==1 & Information==1 
tabulate Donated Information if LessChange==1 & FixedRequest==1, exact
// test Information effect among more change participants in fixed request treatment
sum Donated if MoreChange==1 & FixedRequest==1 & Information==0 
sum Donated if MoreChange==1 & FixedRequest==1 & Information==1 
tabulate Donated Information if MoreChange==1 & FixedRequest==1, exact
// test Information effect among equal change participants in fixed request treatment
sum Donated if loosechangeeffect==1 & FixedRequest==1 & Information==0
sum Donated if loosechangeeffect==1 & FixedRequest==1 & Information==1
// Information effects on change to be donated in open-ended
sum Donated if OpenEnded==1 & TotalDisplayChange!=0 & Information==1
sum Donated if OpenEnded==1 & TotalDisplayChange!=0 & Information==0
sum Donated if OpenEnded==1 & TotalDisplayChange==0 & Information==1
sum Donated if OpenEnded==1 & TotalDisplayChange==0 & Information==0


** Revenue (Section 4.3)
ranksum AmountDonated if FixedRequest==1, by(Information) exact
ranksum AmountDonated if Rounding==1, by(Information) exact
ranksum AmountDonated if OpenEnded==1, by(Information) exact


/* Table 7. Analysis of revenue (per person) */
// Model (1)
reg AmountDonated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (2)
reg AmountDonated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information Earnings Age Male, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information


/* Table 8. Willingness-to-donate models */

// Model (1)
intreg Donation1 Donation2 FixedRequest 1.FixedRequest#1.Information 1.OpenEnded#1.Information if Rounding!=1
*compute R^2
display 1 - e(ll)/e(ll_0)
*Mean WTP (averaged across information conditions)
lincom _cons + 0.5*1.OpenEnded#1.Information
lincom FixedRequest + _cons + 0.5*1.FixedRequest#1.Information
lincom (FixedRequest + _cons + 0.5*1.FixedRequest#1.Information) - (_cons + 0.5*1.OpenEnded#1.Information)
// Model (2)
intreg Donation1 Donation2 FixedRequest 1.FixedRequest#1.Information 1.OpenEnded#1.Information demeaned_Earnings demeaned_Age demeaned_Male if Rounding!=1
*compute R^2
display 1 - e(ll)/e(ll_0)
*Mean WTP (averaged across information conditions)
lincom _cons + 0.5*1.OpenEnded#1.Information
lincom FixedRequest + _cons + 0.5*1.FixedRequest#1.Information
lincom (FixedRequest + _cons + 0.5*1.FixedRequest#1.Information) - (_cons + 0.5*1.OpenEnded#1.Information)
*income elasticities
nlcom _b[demeaned_Earnings]*mean_Earnings/(_b[_cons] + 0.5*_b[1.OpenEnded#1.Information])
nlcom _b[demeaned_Earnings]*mean_Earnings/(_b[_cons]+_b[FixedRequest] + 0.5*_b[1.FixedRequest#1.Information])
nlcom (_b[demeaned_Earnings]*mean_Earnings/(_b[_cons]+_b[FixedRequest] + 0.5*_b[1.FixedRequest#1.Information])) - (_b[demeaned_Earnings]*mean_Earnings/(_b[_cons] + 0.5*_b[1.OpenEnded#1.Information]))
// Model 3
intreg Donation1 Donation2 FixedRequest 1.FixedRequest#1.Information LessChange 1.OpenEnded#1.Information demeaned_Earnings demeaned_Age demeaned_Male if Rounding!=1
*compute R^2
display 1 - e(ll)/e(ll_0)
*Mean WTP (averaged across information conditions)
lincom _cons + 0.5*1.OpenEnded#1.Information
lincom FixedRequest + _cons + 0.5*1.FixedRequest#1.Information
lincom FixedRequest + _cons + 0.5*1.FixedRequest#1.Information + LessChange
*income elasticities
nlcom _b[demeaned_Earnings]*mean_Earnings/(_b[_cons] + 0.5*_b[1.OpenEnded#1.Information])
nlcom _b[demeaned_Earnings]*mean_Earnings/(_b[_cons]+_b[FixedRequest] + 0.5*_b[1.FixedRequest#1.Information])
nlcom _b[demeaned_Earnings]*mean_Earnings/(_b[_cons]+_b[FixedRequest] + 0.5*_b[1.FixedRequest#1.Information] + _b[LessChange])


/* Figure A.2b Reasons for donating, response frequencies */
sum Reason1-Reason7 if Donated==1

/* Figure A.3b Reasons for not donating, response frequencies */
sum Reason1n-Reason9n if Donated==0

/* Table A.1 Cross-tab between enjoying being asked to donate and whether the person donated */
tab Donated DidyouEnjoy

/* Table A.3 Analysis of donation rates (first phase)*/
// Model (1)
regress Donated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information if FirstPhase==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (2)
reg Donated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information Earnings Age Male if FirstPhase==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information


/* Table A.4 Analysis of revenue (first phase) */
// Model (1)
reg AmountDonated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information if FirstPhase==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information
// Model (2)
reg AmountDonated FixedRequest 1.FixedRequest#1.Information Rounding 1.Rounding#1.Information 1.OpenEnded#1.Information Earnings Age Male if FirstPhase==1, robust
*test for differences across mechanisms
test FixedRequest = Rounding
test FixedRequest + 1.FixedRequest#1.Information = Rounding + 1.Rounding#1.Information
test FixedRequest + 1.FixedRequest#1.Information = 1.OpenEnded#1.Information
test Rounding + 1.Rounding#1.Information = 1.OpenEnded#1.Information


